/**
 * @param {number} n - a positive integer
 * @return {number} - a positive integer
 */
var reverseBits = function(n) {
  let num = 0, t = 32;
  while(t--) {
    num <<= 1;
    num |= (n & 1);
    n >>>= 1;
  }
  num = num >>> 0;
  return num;
};
let a = 0b1001;
console.log(reverseBits(a));
